//
//  ResourceLoader.h
//  ResourceLoader
//
//  Created by winston on 13-4-10.
//  Copyright (c) 2013年 winston. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "../../SQLiteHelper/FMResultSet.h"
#import "../../SQLiteHelper/SQLiteHelper.h"


/*----------得到所有汽车品牌----------*/
#define SQL_GETBRANDS   @"select brandid,name from carbrand order by name asc"

/*----------得到某个汽车品牌下所有车系----------*/
#define SQL_GETSERIES   @"select brandid,seriesid,name from carseries where brandid = %d order by name asc"

/*----------得到某个汽车品牌下某个车系的某个车型----------*/
//@hanhaidi@0816@显示指导价
//#define SQL_GETSPEC     @"select brandid,seriesid, specid, name from carspec where brandid = %d and  seriesid = %d order by name asc"
#define SQL_GETSPEC     @"select a.brandid,a.seriesid, a.specid, a.name,b.paravalue from carspec a left join carspecdata b on a.specid=b.specid where b.paraid=2 and a.brandid = %d and  a.seriesid = %d  order by a.name asc"

/*----------得到车型配置的字典----------*/
#define SQL_GETSPECDIC  @"select  paraid,mainname,subname from carspecdic  where disable = 0 order by groupid asc, paraid asc"

/*----------得到某个车型配置的字典----------*/
#define SQL_GETSPECDATA  @"select  a.paraid, a.mainname, a.subname, ifnull(b.paravalue,'-') as paravalue from carspecdic a  left join carspecdata b  on a.paraid = b.paraid and a.disable = 0 and b.specid = %d order by a.groupid asc, a.paraid asc"

/*----------得到本田的车ID----------*/
#define SQL_GETHONDACAR  @"select specid from carhonda where name = '%@'"

#define ResourceLoader_CarExtra_CompanyLogoNameNormal @"car_extra_company_logo_normal"
#define ResourceLoader_CarExtra_CompanyLogoNameSpecial @"car_extra_company_logo_special"

@interface ResourceLoader : NSObject
{
    @private
    NSFileManager*          fileManager;
    SQLiteHelper *          sqliteHelper;
    NSMutableDictionary*    autoDictionary;         //车型的数组
//    NSMutableDictionary*    carExtraInfoDictionary;
}

+(ResourceLoader*)getInstance;

-(void)RefreshAutoDics;
-(NSArray*)getAutoArray;

//得到指定路径的模版文件
-(NSArray*)getTemplatesByPath:(NSString *)path;

//得到某一个车型下某一个模块的文件目录
-(NSString*)getModulePathByKey:(NSString*)moduleKey  withAutoID:(NSString*)autoID;

//得到某一个车型下某一个模块的模版列表
-(NSArray*)getTemplatesByKey:(NSString*)moduleKey  withAutoID:(NSString*)autoID;

//得到智能配置中各项的配置列表
-(NSArray*)getFavoriteTemplatesByPath:(NSString*)path;

//得到车型配置的字典
-(NSArray*)getCarBasicParas;

//得到车型的配置
-(NSArray*)getCarBasicParasByCarSpecId:(NSInteger)specId;



//得到首页车型的图片
-(NSArray*)getHomePageAutoData;
-(NSString*)getHomePageAutoImagePath:(NSString *)autoId;

//得到车型广告视频位置
-(NSString*)getADVideosPath:(NSString*)autoId WithType:(int)type;

//获取车型广告文件名
-(NSString*)getADVideosFileName:(NSString*)autoId type:(NSInteger)type;

//读取360外观的替换图片
-(NSString*)get360Replace:(NSString *)autoId;
//得到某个车型的360度外观数据
-(NSArray*)get360Appear:(NSString*)autoId;
//得到某个车型的360度内饰数据
-(NSArray*)get360Inside:(NSString*)autoId;


//车型选择
-(NSArray*)getAllBrands;
-(NSArray*)getSeriesByBrand:(NSInteger)brandId;
-(NSArray*)getSpecBySeriesId:(NSInteger)seriesId brand:(NSInteger)brandId;
-(NSInteger)getHondaCar:(NSString*)autoNameKey;

// 品牌故事：荣誉概要
-(NSArray*) getBrandHonor:(NSString*) filePath;

@end
